﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Sister : RelationBase
    {
        private static Sister _singleton = new Sister();
        public static Sister Instance
        {
            get { return _singleton; }
        }

        private Sister() { }
        
        public override bool IsRelated(Person a, Person b)
        {
            // b is a's sister IFF b is female and b is a's sibling
            return b.Sex == Sex.Female && a.KnownRelation(Sibling.Instance, b);
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            return new HashSet<IRelation>(new IRelation[] { Sibling.Instance });
        }
    }
}
